package com.aoxin.util;

import java.io.Serializable;
import java.util.List;

public class PageInfo<T> implements Serializable {

	private static final long serialVersionUID = 5772986933599422070L;

	/**
	 * 页码
	 */
	private int pageIndex;
	/**
	 * 每页数量
	 */
	private int pageSize;
	/**
	 * 数据量
	 */
	private Long recordCount;
	/**
	 * 数据
	 */
	private List<T> data;

	public PageInfo(List<T> list) {
		com.github.pagehelper.PageInfo<T> pageInfo = new com.github.pagehelper.PageInfo<T>(list);
		this.pageIndex = pageInfo.getPageNum();
		this.pageSize = pageInfo.getPageSize();
		this.recordCount = pageInfo.getTotal();
		this.data = pageInfo.getList();
	}

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public Long getRecordCount() {
		return recordCount;
	}

	public void setRecordCount(Long recordCount) {
		this.recordCount = recordCount;
	}

	public List<T> getData() {
		return data;
	}

	public void setData(List<T> data) {
		this.data = data;
	}
}
